import 'package:flutter/material.dart';
import 'package:xbaistack/l10n/app_localizations.dart';

final class GlobalContext {
  GlobalContext._();

  static final GlobalContext _instance = GlobalContext._();
  final _key = GlobalKey<NavigatorState>(debugLabel: "Global context");

  static GlobalKey<NavigatorState> get navigatorKey => _instance._key;

  static BuildContext get context => _instance._key.currentContext!;
  static AppLocalizations get l10n => AppLocalizations.of(context);
  static Locale get currentLocale => Localizations.localeOf(context);
}
